<template>
	<j-cell-group>
		<j-cell title="邮件开启" :more="false">
			<view slot="tips">
				<switch :checked="NetWorkNetEmail.Enable" disabled></switch>
			</view>
		</j-cell>
		<j-cell title="使用SSL" :more="false">
			<view slot="tips">
				<switch :checked="NetWorkNetEmail.UseSSL" disabled></switch>
			</view>
		</j-cell>
		<j-cell title="邮件标题" :tips="NetWorkNetEmail.Title" :more="false"></j-cell>
		<j-cell title="发送地址" :tips="NetWorkNetEmail.SendAddr" :more="false"></j-cell>
		<j-cell title="邮箱端口号" :tips="NetWorkNetEmail.Port" :more="false"></j-cell>
		<j-cell-card title="接收人地址" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<template v-for="(item, index) in NetWorkNetEmail.Recievers">
				<j-cell :key="index" :title="'地址' + index" :tips="item" :more="false"></j-cell>
			</template>
		</j-cell-card>
		<j-cell-card title="发送时间段" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<template v-for="(item, index) in NetWorkNetEmail.Schedule">
				<j-cell :key="index" :title="'时间段' + index" :tips="item" :more="false"></j-cell>
			</template>
		</j-cell-card>
		<j-cell-card title="邮箱服务器" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<j-cell title="地址" :tips="NetWorkNetEmail.MailServer.Address" :more="false"></j-cell>
			<j-cell title="匿名" :more="false">
				<view slot="tips">
					<switch :checked="NetWorkNetEmail.MailServer.Anonymity" disabled></switch>
				</view>
			</j-cell>
			<j-cell title="账户" :tips="NetWorkNetEmail.MailServer.Name" :more="false"></j-cell>
			<j-cell title="密码" :tips="NetWorkNetEmail.MailServer.Password" :more="false"></j-cell>
			<j-cell title="端口" :tips="NetWorkNetEmail.MailServer.Port" :more="false"></j-cell>
			<j-cell title="用户名" :tips="NetWorkNetEmail.MailServer.UserName" :more="false"></j-cell>
		</j-cell-card>
	</j-cell-group>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            NetWorkNetEmail: {
                Enable: '',
                UseSSL: '',
                Title: '',
                SendAddr: '',
                Port: '',
                Recievers: [],
                Schedule: [],

                MailServer: {
                    Address: '',
                    Anonymity: '',
                    Name: '',
                    Password: '',
                    Port: '',
                    UserName: ''
                }
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
		this.token = options.token
		this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'NetWork.NetEmail'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                uni.hideLoading({
                    success: (res) => {
                        console.log(result);
                        this.NetWorkNetEmail = result['NetWork.NetEmail']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
